/**
 * 
 */
package temp;

/**
 * @author leiruiqi@hanhai.com
 *
 */
public enum InformationStatus {

	DRAFT(0,"草稿"),//草稿
	AUDIT(1,"待审核"),//待审核
	PUBLISH(2,"发布"),//发布
	REFUSE(3,"退回"),//退回
	//RETRACT(4,"退回"),//撤回
	;
	
	private Integer code;
	
	private String value;
	
	public Integer getCode() {
		return code;
	}

	public String getValue() {
		return value;
	}

	private InformationStatus(int code,String value){
		this.code = code;
		this.value = value;
	}
	
	public static InformationStatus getByCode(int code){
		for(InformationStatus status:InformationStatus.values()){
			if(status.getCode() == code){
				return status;
			}
		}
		return null;
	}
	
	public static void main(String[] args) {

		for(InformationStatus status :InformationStatus.values()){
			System.out.println("code="+status.getCode()+ " values = "+status.getValue());
		}
	}
}
